<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn">
<%@ include file="/WEB-INF/view-system/include/contentTaglib.jsp"%>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>版本管理</title>
</head>
<tags:ajax id="excuteAjax" url="${ctx }/version/replace"/>
<style type="text/css">
.marTop {
	margin-top: 1em
}
.txtCenter {
	text-align: center;
}
</style>
<script type="text/javascript">
function uploadStart(file){
	var type = $('#warType').val();
	$('#versionWar').uploadify("settings","formData",{'type':type});  
}
function oneSucc(file,data,response){
	/* var jso = $.parseJSON(data);
	if(jso.success == false || jso.success = 'false'){
		
	} */
}
function excute(){
	excuteAjax.send();
}
</script>
<body>
	<div class="col-md-2 marTop">
		<select name="type" id="warType" class="form-control">
			<option value="yzj">web</option>
			<option value="api">api</option>
			<option value="innerApi">innerApi</option>
		</select>
	</div>
	<div class="col-md-12 marTop">
		<tags:upload url="${ctx }/version/upload" id="versionWar" name="warUpload"
		autoUpload="true" fileTypeExts="*.war" buttonText="文件上传" 
		removeCompleted="false" uploadLimit="1"
		multiple="false" buttonClass="btn btn-success" onUploadStart="uploadStart"
		onUploadSuccess="oneSucc"/>
	</div>
	<div class="col-md-12 marTop txtCenter">
		<button class="btn btn-primary" onclick="excute()">更换版本</button>
	</div>
</body>
</html>